home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7423 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1017 b 

  1. Path: airdmhor.gen.nz!not-for-mail
  2. From: gumboot@airdmhor.gen.nz (Simon Hosie)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What's better & why
  5. Date: 27 Feb 1996 01:45:20 +1300
  6. Organization: Airdmhor : a couple of BBS's, a bunch of people, and a cat.
  7. Message-ID: <4gsa10$qn6@airdmhor.gen.nz>
  8. References: <31297C5A.E6C@connix.com> <4gf4s6$fl0@kannews.ca.newbridge.com> <4gigbe$t4m@news.microsoft.com>
  9. NNTP-Posting-Host: airdmhor.gen.nz
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Dann Corbit:
  13. > 90% of the time, it is better to make code clear and understandable than
  14. > to tweak out a couple extra cycles.  Using a profiler, identify the hot
  15. > spots in your code that need speed, and tweak them.  Often, cranking
  16. > up the optimization level does a pretty good job of optimizing for us.
  17.  
  18.   So, you could get both readability and efficiency by assigning the
  19. variable to the more likely option and if (something special happens) then
  20. assign the other value.
  21.  
  22.   Or am I the only one that reads if()'s as the thing less likely to happen?
  23.